<?php



//添加用户路由
Route::get('User/add','UserController@add');


//添加用户执行路由
Route::post('User/store','UserController@store');

//用户列表
Route::get('/','UserController@index');

//用户编辑
Route::get('User/edit/{id}','UserController@edit');

//用户修改
Route::post('User/update','UserController@update');

//用户删除
Route::get('User/del/{id}','UserController@del');

Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
    //后台登录
    Route::get('login','LoginController@login');

//验证码
    Route::get('code','LoginController@code');

//验证
    Route::post('verify','LoginController@verify');

    //没有权限路由
    Route::get('noaccess','LoginController@noaccess');
});

//登录中间件
Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware'=>['isLogin','HasRole']],function(){
    //退出登录
    Route::get('logout','LoginController@logout');

    //后台首页
    Route::get('index','IndexController@index');

    //后台首页
    Route::get('desktop','IndexController@desktop');

    //用户统计页
    Route::get('welcome','IndexController@welcome');

    //批量删除
    Route::get("user/delAll",'UserController@delAll');

    //批量删除角色
    Route::get("role/delAll",'RoleController@delAll');

    //角色修改权限页面
    Route::get("role/permiss/{id}",'RoleController@permiss');

    //角色修改权限
    Route::post("role/modifypermiss",'RoleController@modifypermiss');

    //批量删除权限
    Route::get("permission/delAll",'PermissionController@delAll');


    //分类排序路由
    Route::post("cate/changeOrder","CateController@changeOrder");

    //文章图片上传
    Route::post("article/upload","ArticleController@upload");

    /*后台用户模块相关路由*/
    Route::resource('user','UserController');

    //角色模块
    Route::resource('role','RoleController');

    //权限模块
    Route::resource('permission','PermissionController');

    //列表模块
    Route::resource('cate','CateController');

    //列表模块
    Route::resource('article','ArticleController');

});

